﻿Ext.define("PSI.Home.MainForm", {
    config: {
        today: ""
    },

    constructor: function (config) {
      this.initConfig(config);
    },

    createUI: function () {
        var me = this;
        var panel = Ext.create("Ext.panel.Panel", {
            border: 0,
            layout: "border",
            items: [{
                region: "north",
                height: "50%",
                layout: "fit",
                xtype: "container",
                bodyPadding: 10,
                border: false,
                items: [me.createInPlanPanel()]
            }, {
                bodyPadding: 10,
                region: "center",
                xtype: "container",
                layout: "fit",
                border: false,
                items: [me.createOutPlanPanel()]
            }
           ]
        });

        me.panel = panel;
    },

    getMainPanel: function () {
        return this.panel;
    },

    createInPlanPanel: function () {
        var me=this;
        var serverdt = me.getToday();
        var form = Ext.create("PSI.InPlan.TodayPlanForm", { today: me.getToday() });
        form.createUI();
        return form.getMainPanel();
    },

    createOutPlanPanel: function () {
        var me = this;
        var form = Ext.create("PSI.OutPlan.TodayPlanForm", { today: me.getToday() });
        form.createUI();
        return form.getMainPanel();
    }
});